package Bit;

public class Animal {
     protected String name;
     protected int age;
    public Animal()//无参构造函数
     {}

        public Animal(String name,int age)//有参构造
        {
            this.name=name;
            this.age=age;
        }
    //包访问权限
    void eat(String food)
    {
        System.out.println("动物"+"正在吃"+food);
    }
    public Animal func()
    {
        return new Cat();
    }

}
